#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
//char* GetMemory(void)
//{
//	char p[] = "hello world";
//	return p;
//}
//void Test(void)
//{
//	char* str = NULL;
//	str = GetMemory();
//	printf(str);
//}
//int main()
//{
//	/*int a = 248, b = 4;
//	int const* c = 21;
//	const int* d = &a;
//	int* const e = &b;
//	int const* const f = &a;*/
//	int a = 3;
//	Test();
//	//printf("%d\n", (a += a -= a * a));
//	return 0;
//}

void FindTwoNum(int arr[], int n, int* p1, int* p2)
{
	int i = 0;
	int pos = 0;
	int move = 0;
	for (i = 0; i < n; i++)
	{
		pos ^= arr[i];
	}
	for (i = 0; i < n; i++)
	{
		if (pos & (1 << i))
		{
			move = i;
			break;
		}
	}
	*p1 = *p2 = 0;
	for (i = 0; i < n; i++)
	{
		if (arr[i] & (1 << move))
		{
			*p1 ^= arr[i];
		}
		else
		{
			*p2 ^= arr[i];
		}
	}
}

int main()
{
	int arr[] = { 1,1,2,2,3,3,4,5,5,6,7,7,8,8 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	int c1, c2;
	FindTwoNum(arr, sz, &c1, &c2);
	printf("%d %d\n", c1, c2);
	return 0;
}